package com.faqu.online

import com.mongodb.casbah.{MongoClient, MongoClientURI}
import redis.clients.jedis.Jedis

/**
  * Copyright (c) 2018-2028  All Rights Reserved
  *
  * Project: ExampleRecommendSystem
  * Package: com.faqu.online
  * Version: 1.0
  *
  * Created by wsr on 2019/4/28 9:18
  */
// 定义一个连接助手对象，建立到redis和mongodb的连接
object ConnHelper extends Serializable {
  // 懒变量定义，使用的时候才初始化
  lazy val jedis = new Jedis("localhost")
  lazy val mongoClient = MongoClient(MongoClientURI("mongodb://localhost:27017/recommender"))
}
